#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main() {
	int abs(int s);
	int jie, shu, count = 0;
	char zif;
	scanf("%d %c", &shu, &zif);
	for (jie = 1;shu>=2*jie*jie-1; jie++) {}
	jie--;//计算阶数
	for (int i = 1; i <= jie; i++) {//列
		for (int j = 1; j <= 2 * jie - i; j++) {
			if (j < i) {
				printf(" ");
			}
			else {
				printf("%c", zif);
				count++;
			}
		}
		printf("\n");
	}
	for (int i = jie - 1; i > 0; i--) {//列
		for (int j = 1; j <= 2 * jie - i; j++) {
			if (j < i) {
				printf(" ");
			}
			else {
				printf("%c", zif);
				count++;
			}
		}
		printf("\n");
	}
	printf("%d", shu - count);
	return 0;
}
int abs(int s) {
	if (s > 0) {
		return s;
	}
	return -s;
}

